home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / examples / dtksh / WorkProcTest1.z / WorkProcTest1
Encoding:
Text File  |  2003-11-18  |  2.0 KB  |  63 lines

  1. #! /usr/dt/bin/dtksh
  2. #
  3. # WorkProcTest1
  4. #
  5. # Copyright 2000, Silicon Graphics, Inc.
  6. # ALL RIGHTS RESERVED
  7. # UNPUBLISHED -- Rights reserved under the copyright laws of the United
  8. # States.   Use of a copyright notice is precautionary only and does not
  9. # imply publication or disclosure.
  10. #
  11. # U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  12. # Use, duplication or disclosure by the Government is subject to restrictions
  13. # as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  14. # in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  15. # in similar or successor clauses in the FAR, or the DOD or NASA FAR
  16. # Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  17. # 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  18. #
  19. # THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  20. # INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  21. # DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  22. # PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  23. # GRAPHICS, INC.
  24. #
  25. ##########################################################################
  26. #  (c) Copyright 1993, 1994 Hewlett-Packard Company    
  27. #  (c) Copyright 1993, 1994 International Business Machines Corp.
  28. #  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  29. #  (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
  30. #      Novell, Inc.
  31. ##########################################################################
  32.  
  33.  
  34. #
  35. # This sample shell script demonstrates the usage of an Xt workproc
  36. #
  37.  
  38. integer count=5
  39.  
  40. # The work proc will be called five time, at which point it will return
  41. # '1', which will cause it to be automatically unregistered.
  42. function WorkProc1
  43. {
  44.    count=$count-1
  45.    echo "WorkProc1 ("$count")"
  46.    if [ "$count" -eq 0 ] 
  47.    then
  48.       return 1
  49.    else
  50.       return 0
  51.    fi
  52. }
  53.  
  54.  
  55. ######################### Create the Main UI #################################
  56.  
  57. XtInitialize TOPLEVEL workProcTest1 WorkProcTest1 "$0" "$@"
  58.  
  59. XtAddWorkProc ID1 "WorkProc1"
  60.  
  61. XtMainLoop
  62.